<?php

namespace Database\Seeders;

use App\Models\Config;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class ConfigSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $configData = [
            ['key' => 'init_time','value' => time(),'description' => '系统初始化的时间'],
            ['key' => 'wx_mini_app_id','value' => config('ymi.wx.mini_app_id'),'description' => '微信小程序AppID'],
            ['key' => 'wx_mini_app_secret','value' => config('ymi.wx.mini_app_secret'),'description' => '微信小程序密钥AppSecret'],
            ['key' => 'wx_pay_mch_id','value' => '','description' => '微信支付商户号MCH_ID'],
            ['key' => 'wx_pay_secret_key_v3','value' => '','description' => '微信支付商户密钥MCH_SECRET_KEY（V3）'],
            ['key' => 'wx_mp_appid','value' => '','description' => '微信公众号MP_APP_ID'],
            ['key' => 'wx_mp_app_secret','value' => '','description' => '微信公众号密钥AppSecret']
        ];
        Config::query()->truncate();
        Config::query()->insert($configData);
    }
}
